﻿namespace KLS.PPDS.ApplicationService.Provider
{
    sealed internal class ProviderUtility
    {

        /// <summary>
        /// Get a default application name
        /// </summary>
        /// <returns></returns>
        internal static string GetDefaultAppName()
        {
            string defPath;
            try
            {
                string vPath = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath;
                if (string.IsNullOrEmpty(vPath))
                {
                    vPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.ModuleName;
                    int num1 = vPath.IndexOf('.');
                    if (num1 != -1)
                    {
                        vPath = vPath.Remove(num1);
                    }
                }
                if (string.IsNullOrEmpty(vPath))
                {
                    return "/";
                }
                defPath = vPath;
            }
            catch
            {
                defPath = "/";
            }
            return defPath;
        }
    }
}
